#ifndef INTERPOLATOR__H
#define INTERPOLATOR__H
#define X_MIN_MOTION_UNIT system_pulse_equivalent_x
#define Y_MIN_MOTION_UNIT system_pulse_equivalent_y
#define Z_MIN_MOTION_UNIT system_pulse_equivalent_z
#define A_MIN_MOTION_UNIT 0.01f
#define B_MIN_MOTION_UNIT 0.01f
#define C_MIN_MOTION_UNIT 0.01f

#ifdef __cplusplus
extern "C"{
#endif

typedef int IDTYPE;
typedef unsigned int U32TYPE;
typedef enum
{
    ARC_DIR_CW,
    ARC_DIR_CCW
}ARC_DIR_enum_t;

typedef enum
{
    INTERPOLATOR_ERR_OK,
    INTERPOLATOR_ERR_ARC_UNQUALITY_R,
    INTERPOLATOR_ERR_ARC_INVALID_ORIGIN
}interpolator_err_t;

typedef struct
{
	IDTYPE x;
	IDTYPE y;
	IDTYPE z;
	unsigned int quadrant;
}ipoint_t,*ipoint_pt;

typedef struct DDA_Interpolator
{
    IDTYPE x;
    IDTYPE y;
    IDTYPE z;
    IDTYPE i_x;
    IDTYPE i_y;
    IDTYPE i_z;
    IDTYPE d_x;
    IDTYPE d_y;
    IDTYPE d_z;
    ipoint_t start;
    ipoint_t end;
    ipoint_t temp_end;
    IDTYPE ARC_r;
    ARC_DIR_enum_t ARC_dir;
    IDTYPE m;
    struct {
        IDTYPE m_x;
        IDTYPE m_y;
        IDTYPE m_z;
    }overflow_value;
    IDTYPE times;
    U32TYPE flags;
}DDA_Interpolator_t, *DDA_Interpolator_pt;


interpolator_err_t DDA_Arc(DDA_Interpolator_pt dda,IDTYPE s_x, IDTYPE s_y, IDTYPE e_x, IDTYPE e_y, ARC_DIR_enum_t dir);
interpolator_err_t DDA_line(DDA_Interpolator_pt dda,IDTYPE x, IDTYPE y, IDTYPE z);
#ifdef __cplusplus
}
#endif
#endif